// 清除所有存储数据
const clearStorage = () => {
	plus.storage.clear();
}

// 异步清除存储数据
const clearAsync = () => {
	plus.storage.clearAsync(function(){
		console.log("clearAsync success");
	}, function(e){
		console.log("clearAsync failed: "+JSON.stringify(e));
	});
}

// 获取存储数据的个数
const storageCount = () =>{
	return plus.storage.getLength();
}

// 获取存储的键值
const getStorage = (key) => {
	return plus.storage.getItem(key);
}

// 修改或添加键值(key-value)对数据到应用数据存储中
const setStorage = (key, value) => {
	plus.storage.setItem(key, value);
}

// 删除键值
const removeStorage = (key) => {
	plus.storage.removeItem(key);
}



export {
    clearStorage,
    clearAsync,
    storageCount,
    getStorage,
    setStorage,
	removeStorage
}